package pe.com.certicom.moviles.model.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import pe.com.certicom.moviles.model.beans.MotivoDevolucion;
import pe.com.certicom.moviles.model.beans.MotivoDevolucionExample;

import com.ibatis.sqlmap.client.SqlMapClient;


@Repository
public class MotivoDevolucionDAOImpl extends SqlMapClientDaoSupport implements MotivoDevolucionDAO {

	
	@Autowired
	public void createSqlMapClient(SqlMapClient sqlMapClient){
	   setSqlMapClient(sqlMapClient);
	}
	
    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public MotivoDevolucionDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public int countByExample(MotivoDevolucionExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("motivo_devolucion.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public int deleteByExample(MotivoDevolucionExample example) {
        int rows = getSqlMapClientTemplate().delete("motivo_devolucion.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public int deleteByPrimaryKey(String codMotivoDevolucion) {
        MotivoDevolucion key = new MotivoDevolucion();
        key.setCodMotivoDevolucion(codMotivoDevolucion);
        int rows = getSqlMapClientTemplate().delete("motivo_devolucion.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public void insert(MotivoDevolucion record) {
        getSqlMapClientTemplate().insert("motivo_devolucion.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public void insertSelective(MotivoDevolucion record) {
        getSqlMapClientTemplate().insert("motivo_devolucion.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    @SuppressWarnings("unchecked")
    public List<MotivoDevolucion> selectByExample(MotivoDevolucionExample example) {
        List<MotivoDevolucion> list = getSqlMapClientTemplate().queryForList("motivo_devolucion.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public MotivoDevolucion selectByPrimaryKey(String codMotivoDevolucion) {
        MotivoDevolucion key = new MotivoDevolucion();
        key.setCodMotivoDevolucion(codMotivoDevolucion);
        MotivoDevolucion record = (MotivoDevolucion) getSqlMapClientTemplate().queryForObject("motivo_devolucion.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public int updateByExampleSelective(MotivoDevolucion record, MotivoDevolucionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("motivo_devolucion.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public int updateByExample(MotivoDevolucion record, MotivoDevolucionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("motivo_devolucion.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public int updateByPrimaryKeySelective(MotivoDevolucion record) {
        int rows = getSqlMapClientTemplate().update("motivo_devolucion.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    public int updateByPrimaryKey(MotivoDevolucion record) {
        int rows = getSqlMapClientTemplate().update("motivo_devolucion.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table motivo_devolucion
     *
     * @ibatorgenerated Thu Mar 07 10:03:18 COT 2013
     */
    private static class UpdateByExampleParms extends MotivoDevolucionExample {
        private Object record;

        public UpdateByExampleParms(Object record, MotivoDevolucionExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}